﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SoccerEvaluator.Common;
using System.Data;
using SoccerEvaluator.Business;

namespace SoccerEvaluator.WebSite
{
    public partial class MatchList : System.Web.UI.Page
    {
        /// <summary>
        /// 
        /// </summary>
        protected string _groupName;
        
        /// <summary>
        /// 
        /// </summary>
        private int _groupID
        {
            get
            {
                if (Request.QueryString["ID"] != null)
                {
                    return int.Parse(Request.QueryString["ID"]);
                }
                else return 0;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["GroupId"] = _groupID;

            if (!this.IsPostBack)
            {
                try
                {
                    SoccerEvaluatorModelContainer context = new SoccerEvaluatorModelContainer();

                    Group dbGroup = context.Groups.FirstOrDefault(c => c.Id == _groupID);

                    _groupName = dbGroup.Name;
                }
                catch { }

            }
        }

    }
}